package com.example.tagsdemo.utils;

import com.example.tagsdemo.enums.ResultEnum;
import com.example.tagsdemo.vo.LayuiDataVO;
import com.example.tagsdemo.vo.ResultVO;

public class ResultVOUtil {

    public static ResultVO success(){
        return success(null);
    }

    public static ResultVO success(Object data){
        ResultVO resultVO = new ResultVO(ResultEnum.SUCCESS);
        resultVO.setData(data);
        return resultVO;
    }

    public static ResultVO error(ResultEnum resultEnum){
        ResultVO resultVO = new ResultVO(resultEnum);
        return resultVO;
    }

    public static ResultVO error(String msg){
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(200);
        resultVO.setMsg(msg);
        return resultVO;
    }


    public static LayuiDataVO layuiData(Object data,Integer count){
        LayuiDataVO vo = new LayuiDataVO();
        vo.setData(data);
        vo.setCount(count);
        return vo;
    }
}
